<template>
	<!-- 底部弹出层组件 -->
	<div class="pop-up-child">
		<header class="header">
			<p class="title">{{activeTitle ||'活动'}}</p>
			<div class="close" @click="close">
				<Iconfont iconClass="cha1" />
			</div>
		</header>
		<div class="list-content">
			<van-swipe class="my-swipe" :show-indicators='true' indicator-color='#CFCFCF'>
				<van-swipe-item v-for="(item,index) in activeArray" :key=index @click='clickActivity(item)'>
					<div class="connect-img"><img :src="item.imgUrl"></div>
				</van-swipe-item>
			</van-swipe>
		</div>
	</div>
</template>
<script>
	export default {
		components: {},
		props: {
			activeDataArray: Object,
			activeTitle: String,
			roomInfo: Object,
			videoInfo: Object,
		},
		data() {
			return {
				activeArray: [],
			}
		},
		created() {
			if (Array.isArray(this.activeDataArray)) { //数组
				this.activeArray = this.activeDataArray[0].hzbActivityList;
			} else {
				this.activeArray = this.activeDataArray.hzbActivityList;
			}
		},
		methods: {
			close() {
				this.$emit("formChildMsg", {
					type: "footerActionSheetClose",
					data: '',
				})
			},
			clickActivity(v) { //多个弹出框 一个直接跳转
				//targetType  0  app   1  微信
				let {
					id,
					elementId,
					elementType
				} = JSON.parse(sessionStorage.getItem('activityIconInfo'))
				fun.activityDotNumFun(1, id, v.id, elementType, elementId)
				if (window.terminal.weixin) { //weixin
					for (let i = 0; i < v.targetList.length; i++) {
						if (v.targetList[i].targetType == 1) {
							window.location.href = v.targetList[i].linkUrl;
							break;
						} else {
							//console.log('当前跳转url只支持app')
						}
					};
				} else { //app
					for (let i = 0; i < v.targetList.length; i++) {
						if (v.targetList[i].targetType == 0) {
							const item = {
								'link':v.targetList[i].linkUrl,
								'linkType':1
							} 
							fun.linkUrlFloatVideo(item);
							break;
						} else {
							//console.log('当前跳转url只支持微信')
						}
					};
				}
			}
		},
	};
</script>
<style scoped>
	.pop-up-child {
		width: 100%;
		height: 450px;
		background: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 1501;
		border-radius: 20px 20px 0px 0px;
		/* background: salmon; */
	}

	.pop-up-child .header {
		line-height: 64px;
		text-align: center;
		position: relative;
	}

	.pop-up-child .title {
		width: 100vw;
		height: 100px;
		line-height: 100px;
		font-size: 36px;
		font-weight: 500;
		color: #27344B;
	}

	.pop-up-child .close {
		position: absolute;
		top: 0;
		right: 0;
	}

	.pop-up-child .iconcha1 {
		padding: 0 30px;
		font-size: 18px;
		color: #27344B;
	}

	.list-content {
		width: 100vw;
		max-height: calc(56vh - 64px);
		overflow-y: scroll;
	}

	.my-swipe {
		width: 100vw;
		height: 280px;
		/* background-color: saddlebrown; */
	}

	.my-swipe>>>.van-swipe__indicator {
		width: 16px;
		height: 11px;
		border-radius: 6px;
	}

	.my-swipe>>>.van-swipe-item {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.my-swipe>>>.connect-img {
		width: 668px;
		height: 200px;
		border-radius: 10px;
		/* background: sandybrown; */
	}

	.connect-img img {
		width: 668px;
		height: 200px;
		border-radius: 10px;
	}
</style>
